﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:clr="clr-namespace:System;assembly=mscorlib"	
	xmlns:clr2="clr-namespace:System.Collections;assembly=mscorlib"
	xmlns:local="clr-namespace:WPG"
	xmlns:data="clr-namespace:WPG.Data"
	xmlns:converters="clr-namespace:WPG.Converters"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"    
    >

    <!-- WPG SearchListBox Style -->
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyGrid}, ResourceId=ListBoxStyle}" TargetType="{x:Type ListBox}">
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
        <!-- <Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/> -->
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">

                    <Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">

                        <DockPanel LastChildFill="True">
                            <Border DockPanel.Dock="Top" Height="30" CornerRadius="5,5,0,0" Background="{DynamicResource HeaderBackgroundBrush}">
                                <DockPanel LastChildFill="True">
                                    <Border DockPanel.Dock="Right" TextBlock.FontSize="10" Margin="4,4,8,4" CornerRadius="4" Padding="4" Background="#FFB1B1B1" Width="150">
                                        <DockPanel LastChildFill="True">
                                            <Canvas DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Center" Width="22" Height="22">
                                                <Path Width="18.053" Height="18.328" Stretch="Fill" Data="M14.247,0.5 C18.112994,0.5 21.247,3.6340067 21.247,7.5 21.247,11.365993 18.112994,14.5 14.247,14.5 12.775757,14.5 11.410525,14.046114 10.356974,13.164231 L2.467133,21.054071 C2.467133,21.054071 1.9140539,21.577999 1.4999938,21.577999 0.94771242,21.577999 0.5,21.130287 0.5,20.578007 0.5,20.163946 1.0529284,19.639868 1.0529284,19.639868 L8.8727176,11.820078 C7.8251028,10.685783 7.2470002,9.1604033 7.2470002,7.5 7.2470002,3.6340067 10.381007,0.5 14.247,0.5 z" Canvas.Left="2.934" Canvas.Top="1.897">
                                                    <Path.Fill>
                                                        <LinearGradientBrush EndPoint="0.879,0.143" StartPoint="0.087,0.909">
                                                            <GradientStop Color="#FF285D68" Offset="0"/>
                                                            <GradientStop Color="#FFE8EEF0" Offset="1"/>
                                                            <GradientStop Color="#FF59A8BA" Offset="0.269"/>
                                                        </LinearGradientBrush>
                                                    </Path.Fill>
                                                    <Path.Stroke>
                                                        <LinearGradientBrush EndPoint="0.849,0.142" StartPoint="0.151,0.858">
                                                            <GradientStop Color="#FF1E605A" Offset="0"/>
                                                            <GradientStop Color="#FF6CE4D8" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </Path.Stroke>
                                                </Path>
                                            </Canvas>
                                            <TextBox x:Name="searchText" Style="{x:Null}" BorderThickness="0" Background="Transparent" TextAlignment="Left" BorderBrush="{x:Null}" />
                                        </DockPanel>
                                    </Border>
                                    <TextBlock Text="WPG Inventory" FontSize="16" Foreground="{DynamicResource DefaultForegroundBrush}" Margin="8" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                </DockPanel>
                            </Border>

                            <ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </ScrollViewer>

                        </DockPanel>
                    </Border>


                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>